In the month of June, the temperature in Johannesburg, South Africa, varies over the day in a periodic way that can be modeled approximately by a trigonometric function. The lowest temperature is usually around $3^\circ C$, and the highest temperature is around $18^\circ C$. The temperature is typically halfway between the daily high and daily low at both $10\text{ a.m.}$ and $10\text{ p.m.}$, and the highest temperatures are in the afternoon. Find the formula of the trigonometric function that models the temperature $T$ in Johannesburg $t$ hours after midnight. Define the function using radians. $ T(t) = $
Explanation: Let's start by writing a formula for the temperature $t$ hours after $10$ : $00\text{ a.m.}$. Both sine and cosine can be used to model periodic contexts. We can decide which is better fitting by considering the $y$ -intercept. The sine function intercepts the $y$ -axis at its midline, and the cosine function intercepts the $y$ -axis at its peak. Since at $t=0$ the function is halfway between its lowest and highest values, we know it's at its midline, so lets use $\sin t$. At $10$ : $00$ in the morning, the temperature is halfway from $3^\circ C$ to $18^\circ C$, or about $10.5^\circ C$. Since this is halfway between its maximum and minimum values, the midline of this function is $y = 10.5^\circ C$. A sine function intersects its midline twice in each period. The temperature in Johannesburg intersects its midline twice in each day. So the period must be one day, or $24$ hours. The amplitude of this function is the distance from its midline to its maximum, or $7.5^\circ C.$ Since the ordinary sine function $f(t) = \sin t$ has period $2\pi$, midline $y = 0$, and amplitude $1$, we can stretch it horizontally by a factor of $\dfrac{24}{2\pi}$, stretch it vertically by a factor of $7.5$, and move it up $10.5$ units: $ S(t) = {7.5}\sin\left({\dfrac{2\pi}{24}}t\right) + {10.5}$ Since we want the temperature to cross its midline when $t = 10$ (meaning $10$ hours after midnight), we need to move the graph $10$ units to the right. To move the graph $10$ units to the right, we can replace $t$ by $t - 10$ to get the new function $ \begin{aligned}T(t) &= S(t-10) \\&= {7.5}\sin\left({\dfrac{2\pi}{24}}(t-10)\right) + {10.5}\end{aligned}$ The function $ T(t) = 7.5\sin\left(\dfrac{2\pi}{24}(t-10)\right)+10.5$ has period $24$, amplitude $7.5$, and midline $y = 10.5$, and increases past its midline at $t = 10$, so it's a good model of the temperature in Johannesburg.